So in the last part, we programmed our quit button, which feeds out our game and then automatically
closes it, and in this part we're going to be programming our play button, which should be pretty
quick, pretty simple and incredibly fun.
So let's go to our menu buttons blueprint here where we just were, and let's go to our play button.
So we're going to select this here and we're going to create a new event.
So we're going to scroll down in the details panel to the on clicked event.
And you add that event.
And now we are going to add a little bit of programming.
So something to keep in mind when it comes to the design and.
Polish of this system is that when a player presses the play button.
Technically, they could really quickly press the button and then press the settings button or really
quickly press the settings button and accidentally hit the quick button or something like that, preventing
them from actually taking the action that they were intending to take.
So what we need to do is we need to disable input on these basically all these buttons so that when
we hit the play button, we are going to play the game.
We're not going to accidentally mess it up by the player accidentally pressing something else, because
that happens and it's kind of annoying when it does.
So we're just going to take that that variability, that variable.
Out of the equation, so let's go back to our event here and let's get references to all of these buttons,
going to just drag each one of these out and get a reference to all of them.
And then remember what we did with the not hit testable setting, but what we're going to do is we are
going to use that to make it so that we cannot click on these buttons.
So I'm just going to drag off of one of these and set the visibility.
And rather than, you know, actually making it like an invisible button, I'm just going to make it
not hit testable.
Let's do self and all children, and then I will plug in these other buttons as well.
So now, as soon as we press the play button, none of these other buttons are going to be able to interfere
with anything.
There's no chance for it.
So the next thing that we're going to do is we're going to create our feed widget again so that we can
actually feed into into our new level, so we can actually just duplicate this from up here as well
as our Delanoe.
And we could just copy all of the stuff, paste it down here.
So now we're going to fade to black and after point five seconds, we will be able to open up a level.
But as you may recall much earlier in this course, in our level blueprint, when we were kind of disabling
all of our, you know, player movement and stuff, we sent our input mode to UI only.
Now us setting this in the player controller, this setting will actually persist through levels.
So as soon as we load up a new level, we still won't be able to move.
So what we need to do is right before we actually load it, load up a new level, we need to get our
player controller and we need to set the input mode.
To gain only.
So now.
When we load into any new level, we will actually be able to move, which is pretty important, and
every single game ever.
So now after this point, you at this point, you might not be doing the same thing as I am.
I'm just going to keep this very simple and I'm just going to go open level, open level by name.
And I'll just load into the first first person example, Matt.
And.
You know, if you have a safe system in your game or something like that, then this is probably going
to look a little bit different because you're probably going to want to, you know, play the game from
either a specific level or you might want to load in with some other settings.
So if you're doing something like that.
You know, you might have, you know, some kind of an integer value, you know, and you might have
like a switch on intr something.
Just to specify which level you're loading into, depending on the save point you're at.
Obviously this is just a more simple tutorial for smaller projects, game jams, student projects,
small games in general.
But obviously there's plenty of room for expansion.
You can do whatever the heck you want.
It's just kind of a place where you can get started with widget blueprints and all that.
So it's just basically just all you need to know is at this point, you just put in whatever code you
need to to load into the correct level that you want.
With that, if we were to save this and if we were to play this now and hit the play button on our main
menu, we see it fades out.
And hey, now we are in our first person example just like that.
You may have noticed we've got a little bit of a hard cut there out from black.
So one thing that we could do to fix this is we could actually add our feed widget in the first person
example map.
Right.
We could make it so that in the level blueprint on November gameplay, we create our feed widget and,
you know, play it in reverse so that it fades from black back out to, you know, completely non opaque.
But I'm not going to worry about that too much if, you know, if that's in effect that you want in
your games.
Obviously, you can do that yourself.
I trust that you could put that together and that is going to be it for this part where we have covered
programming our play button.
So that's what we're going to be getting into the settings button, which is going to be a fun one.
It's going to be a fun one and.
Yes, I will see you in that next part.